% One-dimensional Ermitian polynomial generating functions
% ======== terms ========================== order ==== symbols
function term=Hermite_Polynomials_1D(order, x)
x=sym(x); %Symbolize the input
term2=sym([1;x]); % first two terms of the Hermite polynomial
term =sym(zeros(order+1,1)); %initialise the term matrix
    for i=1:order+1
        if i<3
            term(i)=term2(i); %assign by first two terms
        else
            term(i)=x*term(i-1)-(i-2)*term(i-2); %assign by recursive formula
        end
    end
term =term./sqrt(factorial(0:order)');
term =simplify(term); %simplify polynomial
end